package net.jarang.study.spring.web;

import net.jarang.study.spring.board.VisitBO;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;


@Controller
public class VisitController {
	@Autowired VisitBO visitBO;
	
	public void setVisitBO(VisitBO visitBO) {
		this.visitBO = visitBO;
	}
	
	@RequestMapping("/visit")
	public ModelAndView visit(String userId) {
		visitBO.visit(userId);
		ModelAndView mav = new ModelAndView("result");
		mav.addObject("result1", userId);
		return mav;
	}
	
	@RequestMapping("/hello1")
	public ModelAndView hello1(String userId) {
		ModelAndView mav = new ModelAndView("result");
		mav.addObject("result1", userId);
		return mav;
	}	
}
